<template>
    <div class="detail-box">
        <div class="items">
            <div class="label bb br">企业名称</div><div class="value bb br">{{obj.data.name}}</div>
        </div>
        <div class="items">
            <div class="label bb br">统一社会信用代码</div><div class="value bb br">{{obj.data.unifiedcode}}</div>
        </div>
        <div class="items">
            <div class="label bb br">法定代表人</div><div class="value bb">{{obj.data.man}}</div>
        </div>
        
        <div class="items">
            <div class="label bb br">公司类型</div><div class="value bb br">{{proxy.$utils.findObj(obj.data.companytype,globalData.companyTypeList,'value').text}}</div>
        </div>
        <div class="items">
            <div class="label bb br">所属行业</div><div class="value bb br">{{proxy.$utils.findObj(obj.data.industry,globalData.industryList,'value').text}}</div>
        </div>
        <div class="items">
            <div class="label bb br">注册资本</div><div class="value bb">{{obj.data.registeredcapital}}</div>
        </div>
        
        <div class="items">
            <div class="label bb br">实缴资本</div><div class="value bb br">{{obj.data.paidincapital}}</div>
        </div>
        <div class="items">
            <div class="label bb br">注册号</div><div class="value bb br">{{obj.data.registrationnumber}}</div>
        </div>
        <div class="items">
            <div class="label bb br">注册地址</div><div class="value bb">{{obj.data.address}}</div>
        </div>
        
        <div class="items">
            <div class="label bb br">组织机构代码</div><div class="value bb br">{{obj.data.orgcode}}</div>
        </div>
        <div class="items">
            <div class="label bb br">纳税人识别号</div><div class="value bb br">{{obj.data.taxnumber}}</div>
        </div>
        <div class="items">
            <div class="label bb br">经营状态</div><div class="value bb">{{proxy.$utils.findObj(obj.data.operating,globalData.operatingStatusList,'value').text}}</div>
        </div>
        
        <div class="items">
            <div class="label bb br">成立日期</div><div class="value bb br">{{obj.data.incorporation}}</div>
        </div>
        <div class="items">
            <div class="label bb br">核准日期</div><div class="value bb br">{{obj.data.approval}}</div>
        </div>
        <div class="items">
            <div class="label bb br">曾用名</div><div class="value bb">{{obj.data.usedname}}</div>
        </div>
        
        <div class="items">
            <div class="label bb br">登记机关</div><div class="value bb br">{{obj.data.registrationauthority}}</div>
        </div>
        <div class="items">
            <div class="label bb br">经营地址</div><div class="value bb br">{{obj.data.businessaddress}}</div>
        </div>
        <div class="items">
            <div class="label bb br">经营范围</div><div class="value bb">{{obj.data.businessnature}}</div>
        </div>

        <div class="items l-flex1">
            <div class="label br">企业介绍</div><div class="value v-flex1"><div v-html="obj.data.msg"></div></div>
        </div>
    </div>
</template>

<script setup>
    import { reactive,ref,getCurrentInstance,toRaw,inject } from 'vue'
    import DatePicker from "@/components/date_picker.vue"
    import Editer from "@/components/editer.vue"
    let { proxy } = getCurrentInstance()
    const props = defineProps({
        company_id: { type: String }
    })
    let obj = reactive({
        data:{
            id: props.company_id || '0',
            name: "",
            management_id:0,
            garden_id: 0,
            unifiedcode:"",
            man:"",
            companytype:"",
            industry:"",
            registeredcapital:"",
            paidincapital:"",
            registrationnumber:"",
            address: "",
            orgcode:"",
            taxnumber:"",
            operating:"",
            incorporation:"",
            approval:"",
            usedname:"",
            registrationauthority:"",
            businessaddress:"",
            businessnature:"",
            msg:"",
        },
    })

    let init = () => {
        if(obj.data.id > 0){
            proxy.$ajax({
                url: 'company/get',
                data: obj.data,
                bfLoading: true
            }).then(d => {
                if(d.success){
                    obj.data = {...obj.data, ...d.msg}
                    obj.data.companytype = parseInt(obj.data.companytype)
                    obj.data.industry = parseInt(obj.data.industry)
                    obj.data.operating = parseInt(obj.data.operating)
                }else{
                    proxy.elMessageMixin(d.err, 'error')
                }
            }).catch(() => { })
        }
    }
    init()
</script>

<style scoped>
</style>